﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Admin/Main.master"
    Title="图文列表" CodeFile="PicList.aspx.cs" Inherits="Admin_PicList" %>

<%@ Register TagPrefix="uc" TagName="ContentMenu" Src="~/Admin/ContentMenu.ascx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="LeftMenu" runat="Server">
    <uc:ContentMenu ID="ContentMenu" runat="server" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MidContent" runat="Server">
    <div id="mainMenu">
        <ul>
            <li>
                <asp:HyperLink ID="PicLink" runat="server">添加图文</asp:HyperLink>
            </li>
            <li><a href="PicList.aspx">图文列表</a></li><li><a href="PicEdit.aspx">图文编辑</a></li><li>
                <a href="PicClass.aspx">分类管理</a></li></ul>
    </div>
    <div id="main">
        <asp:Label ID="Msg" runat="server" Text="" CssClass="msg" Visible="False"></asp:Label>
        <table width="100%" border="0" cellpadding="2" cellspacing="1" bgcolor="#D7D7D7"
            id="mainTopTable">
            <tr>
                <td colspan="5" bgcolor="#FFFFFF" class="mainTitle">
                    "<asp:Label ID="MenuName" runat="server" ForeColor="Black"></asp:Label>" 图文检索&nbsp;
                </td>
            </tr>
            <tr>
                <td align="right" bgcolor="#FFFFFF">
                    属于分类:
                </td>
                <td bgcolor="#ffffff">
                    <asp:DropDownList ID="ClassList" runat="server">
                    </asp:DropDownList>
                </td>
                <td bgcolor="#FFFFFF" align="right">
                    图文标题/内容:
                </td>
                <td bgcolor="#FFFFFF">
                    &nbsp;<asp:TextBox ID="PicTitle" runat="server" CssClass="inputText"></asp:TextBox>
                    <asp:HiddenField ID="IsSearch" runat="server" Value="0" />
                </td>
                <td bgcolor="#ffffff">
                    <asp:Button ID="Search" runat="server" CssClass="inputBt" Text="图文检索" OnClick="Search_Click"
                        ValidationGroup="PicSearch" />
                </td>
            </tr>
        </table>
        <asp:GridView ID="PicList" runat="server" AllowPaging="True" AutoGenerateColumns="False"
            OnPageIndexChanging="PicList_PageIndexChanging" DataKeyNames="PicId,PicClassId"
            OnRowCancelingEdit="PicList_RowCancelingEdit" OnRowEditing="PicList_RowEditing"
            OnRowUpdating="PicList_RowUpdating" PageSize="11" OnRowDeleting="PicList_RowDeleting"
            CellPadding="0" CssClass="gv" Width="100%" EmptyDataText="暂无任何图文" OnRowDataBound="PicList_RowDataBound">
            <Columns>
                <asp:BoundField DataField="PicId" HeaderText="ID">
                    <ControlStyle CssClass="gvOrderId" />
                </asp:BoundField>
                <asp:BoundField DataField="ClassName" HeaderText="所属分类" ReadOnly="True" SortExpression="ClassName" />
                <asp:BoundField DataField="Title" HeaderText="图文标题" ReadOnly="True" SortExpression="Title" />
                <asp:HyperLinkField DataNavigateUrlFields="PicPathSmall" HeaderText="小图预览" Target="_blank"
                    Text="小图预览" />                
                <asp:BoundField DataField="AddTime" HeaderText="添加时间" ReadOnly="True" SortExpression="AddTime" />
                <asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="80px" HeaderText="热点/推荐">
                    <ItemTemplate>
                        <asp:CheckBox ID="ProductsLock" runat="server" AutoPostBack="True" Checked='<%# Eval("Hot").ToString() == "True" ? true:false %>'
                            OnCheckedChanged="ProductsLock_CheckedChanged" />/
                        <asp:CheckBox ID="ProductsLocks" runat="server" AutoPostBack="True" Checked='<%# Eval("Groom").ToString() == "True" ? true:false %>'
                            OnCheckedChanged="ProductsLocks_CheckedChanged" />
                    </ItemTemplate>
                    <ItemStyle CssClass="gvBtAField" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="操作" ShowHeader="False">
                    <EditItemTemplate>
                        <asp:Button ID="UpdateBt" runat="server" CausesValidation="True" CommandName="Update"
                            Text="更新" />
                        <asp:Button ID="CancelBt" runat="server" CausesValidation="False" CommandName="Cancel"
                            Text="取消" />
                    </EditItemTemplate>
                    <ItemStyle CssClass="gvCommandField" />
                    <ItemTemplate>
                        &nbsp;<asp:Button ID="DelBt" runat="server" CausesValidation="False" CommandName="Delete"
                            Text="删除" />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="编辑图文">
                    <ItemStyle CssClass="gvBtAField" />
                    <ItemTemplate>
                        <asp:HyperLink ID="EditHyperLink" runat="server" NavigateUrl='<%# Eval("PicId", "PicEdit.aspx?PicId={0}") %>'
                            Text="编辑图文"></asp:HyperLink>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <RowStyle CssClass="gvRow" />
            <EditRowStyle CssClass="gvEditRow" />
            <PagerStyle CssClass="gvPage" />
            <HeaderStyle CssClass="gvHeader" />
            <AlternatingRowStyle CssClass="gvAlternatingRow" />
        </asp:GridView>
    </div>
    <div id="pic-window" class="x-hidden">
        <div class="x-window-header">
            图片预览</div>
    </div>

    <script language="JavaScript" type="text/javascript">
        topMenuThisPage(2);//当前位置顶部菜单标识
        contentSubMenuThisPage();//当前位置左侧菜单标识
        mainMenuThisPage(2);//当前选项卡标识
        showPic();//预览图片
    </script>

</asp:Content>
